<include file="Common/header-control" />
<div class="row">
    <div class="col-md-12">
        <ul class="nav nav-tabs">
            <li{$type == 'compat' ? ' class="active"' : ''}><a href="{:U('control/extend/install')}">安装扩展 <span class="badge">{:count($entities['compat'])}</span></a></li>
            <li{$type == 'nocompat' ? ' class="active"' : ''}><a href="{:U('control/extend/install?t=nocompat')}">不兼容的扩展 <span class="badge">{:count($entities['nocompat'])}</span></a></li>
        </ul>
    </div>
    <if condition="$type == 'compat'">
        <div class="box col-md-12">
            <div class="box-inner">
                <div class="box-header well" data-original-title="">
                    <h2><i class="fa fa-list"></i> 扩展列表</h2>
                </div>
                <div class="box-content">
                    <if condition="!empty($entities[$type])">
                        <foreach name="entities[$type]" item="row">
                            <div class="media" style="margin:10px auto;">
                                <a class="pull-left" href="javascript:;">
                                    <img src="{$row['icon']}" class="img-rounded" width="80" height="80">
                                </a>
                                <div class="media-body">
                                    <div class="row">
                                        <div class="col-sm-9">
                                            <h4 class="media-heading"><a href="javascript:;">{$row['title']}</a></h4>
                                            <div class="help-block">{$row['description']}</div>
                                            <div class="help-block"> <span class="label label-success">{$types[$row['type']]['title']}</span></div>
                                            <div class="help-block">开发商: {$row['author']}</div>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="btn-group btn-group-sm btn-group-justified">
                                                <a class="btn btn-primary" href="{:U('control/extend/install?addon=' . $row['name'])}">安装</a>
                                                <a class="btn btn-default" href="{$row['url']}" target="_blank">发布页</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </foreach>
                        <else/>
                        <div class="alert alert-info">还没有这类型的扩展</div>
                    </if>
                </div>
            </div>
        </div>
        <else/>
        <div class="box col-md-12">
            <div class="box-inner">
                <div class="box-header well" data-original-title="">
                    <h2><i class="fa fa-list"></i> 不能兼容的扩展</h2>
                </div>
                <div class="box-content">
                    <if condition="!empty($entities[$type])">
                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width:120px;">目录</th>
                                <th style="min-width:400px;">错误信息</th>
                            </tr>
                            <foreach name="entities[$type]" item="row">
                            <tr>
                                <td>{$row['name']}</td>
                                <td>{$row['message']}</td>
                            </tr>
                                </foreach>
                            </tbody>
                        </table>
                        <else/>
                        <div class="alert alert-info">没有不兼容的扩展</div>
                    </if>
                </div>
            </div>
        </div>
    </if>
</div>
<include file="Common/footer-control" />
